package com.ninth_group.controller;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.ninth_group.result.R;
import com.ninth_group.service.PCWeatherInfoService;
import com.ninth_group.vo.PCWeatherInfoVO;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 获取所有省会天气信息
 */
@RestController
@RequestMapping("/pc")
public class PCWeatherInfoController {
    @Resource
    private PCWeatherInfoService pcWeatherInfoService;

    @GetMapping
    public R getPCWeatherInfo() throws JsonProcessingException {
        List<PCWeatherInfoVO> pcWeatherInfo = pcWeatherInfoService.getPCWeatherInfo();
        return R.ok("获取成功", pcWeatherInfo);
    }
}
